#!/bin/bash

#Make sure an output filename was provided
if [ $# -eq 0 ]
then
	echo "$0 : You must supply an output filename!"
	exit
fi

#get the testname from the command line
TESTNAME=$1

#TESTNAME=IDSOFF
SIMDURATION=60
NODECOUNT=8
PLATFORM=micaz
TOPOLOGY=./8radialsmall.top
TESTRUNS=1
#MONITORS=c-print
#MONITORS=packet
#MONITORS="c-print,packet,energy -show-packets=false  -VariableName=debugbuf1"
#LOGFILES="-logfile=energy.txt -printlogfile=test.txt"
MONITORS="c-print,packet,energy -show-packets=false -VariableName=debugbuf1"

mkdir ./${TESTNAME}

for ((i=1; i<=$TESTRUNS; i++ ))
do
	LOGFILES="-printlogfile=./${TESTNAME}/print${i}_ -logfile=./${TESTNAME}/energy${i}_"
	java avrora.Main -simulation=sensor-network -nodecount=$NODECOUNT -platform=$PLATFORM -monitors=${MONITORS} ${LOGFILES} -seconds=$SIMDURATION -topology=static -topology-file=$TOPOLOGY main.elf > ./${TESTNAME}/test${i}.txt
done

#./makelf.sh
#java avrora.Main -simulation=sensor-network -nodecount=$NODECOUNT -platform=$PLATFORM -monitors=${MONITORS} -seconds=$SIMDURATION -stagger-start=10000 -topology=static -topology-file=$TOPOLOGY main.elf
#java avrora.Main -simulation=sensor-network -nodecount=$NODECOUNT -platform=$PLATFORM -monitors=${MONITORS} -seconds=$SIMDURATION -topology=static -topology-file=$TOPOLOGY main.elf > 

exit
